Unofficial Java client library for the Android Google Keep API
If you have an Enterprise account, it is an option to use official Google Keep API
The library can be used to access data from Google Keep as an Android device
import io.github.rukins.gkeepapi.GKeepAPI;
import io.github.rukins.gkeepapi.NodeRequestBuilder;
import io.github.rukins.gkeepapi.model.gkeep.NodeResponse;
import io.github.rukins.gkeepapi.model.gkeep.node.Color;
import io.github.rukins.gkeepapi.model.gkeep.node.nodeobject.ListItemNode;
import io.github.rukins.gkeepapi.model.gkeep.node.nodeobject.NoteNode;
import io.github.rukins.gkeepapi.model.gkeep.userinfo.Label;
import io.github.rukins.gkeepapi.utils.NodeUtils;
import io.github.rukins.gpsoauth.exception.AuthError;
public class App {
public static void main(String[] args) throws AuthError {
GKeepAPI gKeepAPI = new GKeepAPI("aas_et/**");
NodeResponse fullData = gKeepAPI.changes();
NodeRequestBuilder nodeRequestBuilder = NodeRequestBuilder.builder();
NoteNode noteNode = nodeRequestBuilder.createNoteNode(
NoteNode.builder()
.title("some title")
.listItemNode(
ListItemNode.builder()
.text("some text")
.build()
)
.build()
);
Label label = nodeRequestBuilder.createOrUpdateLabel(
Label.builder()
.mainId(IdUtils.generateId())
.name("some label")
.build()
);
noteNode = nodeRequestBuilder.addLabelToNoteNode(noteNode, label);
noteNode = nodeRequestBuilder.pinNoteNode(noteNode);
noteNode.setColor(Color.RED);
noteNode.setTitle("new title");
noteNode.getListItemNode().setText("new text");
noteNode = nodeRequestBuilder.createOrUpdateNoteNode(noteNode);
System.out.println(noteNode);
NodeResponse nodeResponse = gKeepAPI.changes(nodeRequestBuilder.build());
NodeResponse newState = NodeUtils.mergeNodeResponses(fullData, nodeResponse);
NodeUtils.getAssembledAbstractNodeList(newState.getNodes()).forEach(System.out::println);
}
}
Available here
See Maven Central or Maven repository
<dependency>
<groupId>io.github.rukins</groupId>
<artifactId>gkeepapi</artifactId>
</dependency>
implementation group: 'io.github.rukins', name: 'gkeepapi'
implementation("io.github.rukins:gkeepapi")
In the Issues section you can suggest any improvements and report any bugs you find
This is an open-source project and all contributions are highly welcomed
Released under MIT License